package com.java.parallel.threadBand.minsheng;

import java.util.Scanner;

/**
 * @author guoyu
 * @date 2022/12/3
 * @Version 1.0
 * @Description TODO
 */
public class Main1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        int[] res = deal(n, k);
        for (int i = 0; i < n; i++) {
            System.out.print(res[i]);
        }
    }

    private static int[] deal(int n, int k) {
        int res[] = new int[n];
        if (k+1 == n) {
            int temp = n;
            for (int i = 0; i< n; i++) {
                res[i] = temp;
                temp--;
            }
        } else {
            int temp = k + 1;
            for (int i = 0; i < k; i++) {
                res[i] = temp--;
            }
            int temp2 = k + 1;
            for (int i = k; i < n; i++) {
                res[k] = temp2++;
            }
        }
        return res;
    }
}
